/*******************************************************************************
*
*   Copyright ©2009 Alexandru Marin
*
*   This file is part of nwave/pMRI C library.
*
*   This project started as an MSc degree project during a
*   stage at the Paris-Est university, under joint supervision of prof.
*   Bogdan Ionescu (Image Analysis and Processing Laboratory, "Politehica"
*   University of Bucharest), Caroline Chaux and Jean-Christophe Pesquet
*   (Laboratoire d'Informatique, Université Paris-Est, Institut Gaspard Monge).
*
*   nwave/pMRI C libray is free software: you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation, either version 2 of the License, or
*   (at your option) any later version.
*
*   nwave/pMRI C libray is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*
*   You should have received a copy of the GNU General Public License
*   along with nwave/pMRI C library.  If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/

#ifndef DWT_TYPES_H_
#define DWT_TYPES_H_

#include <string.h>

typedef enum {
	BORDER_PAD_ZERO,
	BORDER_SYM_HALF,
	BORDER_SYM_WHOLE,
	BORDER_CDJV,
	BORDER_CDJV_COND,
	BORDER_PERIOD
} dwt_border_t;

/**
 * This macro evaluates to a human-readable string representing the enum value
 */
#define DWT_BORDER_TO_STR(dwt_border) \
	((dwt_border)==BORDER_PAD_ZERO?"BORDER_PAD_ZERO":\
	((dwt_border)==BORDER_SYM_HALF?"BORDER_SYM_HALF":\
	((dwt_border)==BORDER_SYM_WHOLE?"BORDER_SYM_WHOLE":\
	((dwt_border)==BORDER_CDJV?"BORDER_CDJV":\
	((dwt_border)==BORDER_CDJV_COND?"BORDER_CDJV_COND":\
	((dwt_border)==BORDER_PERIOD?"BORDER_PERIOD":"BORDER_UNKNOWN"))))))

typedef struct {
	int degree;
	float** leftprecond;
	float** rightprecond;
	float** leftpostcond;
	float** rightpostcond;
	float** lefthipass;
	float** righthipass;
	float** leftlopass;
	float** rightlopass;
} dwt_cdjv_t;

typedef struct {
	int nbands;
	int length;
	float** d_filters;
	float** r_filters;
	dwt_cdjv_t* cdjv;
	char* name;
} dwt_filter_t;


typedef struct {
	int ndims;
	int* res_levels;
	dwt_border_t* border_strategies;
	dwt_filter_t** filters;
} dwt_params_t;

#endif /* DWT_TYPES_H_ */
